package com.ocm.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.ocm.core.service.StorageService;

@Controller
public class SearchController {

   public static final String SEARCH_PAGE = "search/search";

   private StorageService storageService;

   @Autowired
   public SearchController(
      @Qualifier("storageService") StorageService storageService) {
      this.storageService = storageService;
   }

   @RequestMapping(value = "/search/{storageId}/search", method = RequestMethod.GET)
   public String viewSearchPage(@PathVariable("storageId")long storageId, ModelMap model) {
      model.addAttribute("storageId", storageId);
      return SEARCH_PAGE;
   }
}
